Skip to content

feat(solid-query): add 'mutationOptions'#10138

Merged
birkskyum merged 6 commits intoTanStack:mainfrom
sukvvon:feat/solid-query-mutationOptions
Mar 18, 2026
Merged

feat(solid-query): add 'mutationOptions'#10138
birkskyum merged 6 commits intoTanStack:mainfrom
sukvvon:feat/solid-query-mutationOptions

Conversation

@sukvvon
Copy link
Contributor

@sukvvon sukvvon commented Feb 16, 2026

🎯 Changes

Add mutationOptions identity function to @tanstack/solid-query, matching the existing react-query and preact-query implementations.

  • packages/solid-query/src/mutationOptions.ts — identity function with 2 overloads (with/without mutationKey)
  • packages/solid-query/src/index.ts — export mutationOptions
  • packages/solid-query/src/__tests__/mutationOptions.test.tsx — 14 runtime tests
  • packages/solid-query/src/__tests__/mutationOptions.test-d.tsx — 13 type tests
  • docs/framework/solid/reference/mutationOptions.md — docs (ref to react docs)

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • New Features

    • Introduced a new mutationOptions utility to improve type safety for mutation configurations, including explicit handling of mutation keys and callback typings.
  • Documentation

    • Added a reference page documenting mutationOptions.
  • Tests

    • Added extensive type-safety and integration tests covering mutation behavior, key filtering, hook interactions, and state tracking.

@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: 879b859

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@tanstack/solid-query Minor
@tanstack/solid-query-devtools Major
@tanstack/solid-query-persist-client Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added documentation Improvements or additions to documentation package: solid-query labels Feb 16, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 58cb7da5-1c42-477b-99c8-433b7f20fb97

📥 Commits

Reviewing files that changed from the base of the PR and between 8490b9e and 184b6fb.

📒 Files selected for processing (1)
  • packages/solid-query/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/solid-query/src/index.ts

📝 Walkthrough

Walkthrough

Adds a new exported mutationOptions utility to Solid Query (type-level overloads for required/optional mutationKey), plus docs, tests, and a changeset entry for a minor version bump.

Changes

Cohort / File(s) Summary
Changeset & Docs
\.changeset/quick-taxes-cover.md, docs/framework/solid/reference/mutationOptions.md
Adds a changeset entry for a minor version bump and a new reference docs page for mutationOptions.
Public API Export
packages/solid-query/src/index.ts
Re-exports mutationOptions from the package index to make it part of the public API.
Core Implementation
packages/solid-query/src/mutationOptions.ts
Adds mutationOptions with three TypeScript overloads (required mutationKey, omitted mutationKey, and full options); implementation returns the input unchanged as a type-level helper.
Type Tests
packages/solid-query/src/__tests__/mutationOptions.test-d.tsx
Adds extensive TypeScript type-safety tests covering excess property rejection, callback/variable/data/context inference, and integration with useMutation, useIsMutating, queryClient.isMutating, and useMutationState.
Runtime Tests
packages/solid-query/src/__tests__/mutationOptions.test.tsx
Adds runtime tests validating pass-through behavior and interactions with useIsMutating, useMutationState, and queryClient.isMutating, including keyed vs unkeyed and concurrent mutation scenarios.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A tiny helper hugged in types and key,
I hop through tests both strict and free,
Docs whisper what the code makes plain,
A changeset marks the minor gain,
Solid Query hops onward with glee.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(solid-query): add mutationOptions' directly and clearly describes the main change: adding the mutationOptions feature to the solid-query package.
Description check ✅ Passed The description follows the repository template with all required sections filled: changes are detailed, checklist items are marked, and release impact is addressed with a changeset generated.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.

OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required.

@nx-cloud
Copy link

nx-cloud bot commented Feb 16, 2026

View your CI Pipeline Execution ↗ for commit 42a4a2e

Command Status Duration Result
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 20s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-18 02:00:24 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 16, 2026

More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@10138

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@10138

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@10138

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@10138

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@10138

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@10138

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@10138

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@10138

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@10138

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@10138

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@10138

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@10138

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@10138

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@10138

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@10138

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@10138

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@10138

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@10138

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@10138

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@10138

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@10138

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@10138

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@10138

commit: 42a4a2e

@sukvvon sukvvon force-pushed the feat/solid-query-mutationOptions branch from 8490b9e to 879b859 Compare February 24, 2026 01:08
@TkDodo TkDodo requested a review from birkskyum February 25, 2026 19:47
@sukvvon
Copy link
Contributor Author

sukvvon commented Mar 18, 2026

@birkskyum Could you review this PR?

@birkskyum
Copy link
Member

thanks for looking into this!

@birkskyum birkskyum merged commit 09397ca into TanStack:main Mar 18, 2026
7 of 8 checks passed
@github-actions github-actions bot mentioned this pull request Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation package: solid-query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants